<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Spring Boot,Spring Security," />










<meta name="description" content="Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限">
<meta name="keywords" content="Spring Boot,Spring Security">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring Boot Security进阶(一)">
<meta property="og:url" content="http://yoursite.com/2018/12/18/Spring-Boot-Security进阶-一/Spring-Boot-Security进阶-一/index.html">
<meta property="og:site_name" content="程序员乌托邦">
<meta property="og:description" content="Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/DBBD0A36-47D3-40B2-936A-B98940BA6BE7.png">
<meta property="og:image" content="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/7E2F2A68-45FF-4F1A-A8A7-B55B4AF143DF.png">
<meta property="og:updated_time" content="2018-12-18T08:21:40.819Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Spring Boot Security进阶(一)">
<meta name="twitter:description" content="Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限">
<meta name="twitter:image" content="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/DBBD0A36-47D3-40B2-936A-B98940BA6BE7.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/12/18/Spring-Boot-Security进阶-一/Spring-Boot-Security进阶-一/"/>





  <title>Spring Boot Security进阶(一) | 程序员乌托邦</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">程序员乌托邦</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/18/Spring-Boot-Security进阶-一/Spring-Boot-Security进阶-一/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wolf、Heart">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="程序员乌托邦">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Spring Boot Security进阶(一)</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-12-18T16:03:37+08:00">
                2018-12-18
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring-Boot/" itemprop="url" rel="index">
                    <span itemprop="name">Spring Boot</span>
                  </a>
                </span>

                
                
                  ， 
                
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Spring-Security/" itemprop="url" rel="index">
                    <span itemprop="name">Spring Security</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="Spring-Boot-Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限"><a href="#Spring-Boot-Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限" class="headerlink" title="Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限"></a>Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限</h3><a id="more"></a>
<h1 id="一、权限系统分析"><a href="#一、权限系统分析" class="headerlink" title="一、权限系统分析"></a>一、权限系统分析</h1><p>权限系统的设计：</p>
<ol>
<li>用户</li>
<li>角色</li>
<li>权限</li>
</ol>
<p>给用户分配相应的角色，给角色赋予相应的权限，那么用户就有了相应的角色</p>
<p>用户和角色的对应关系：一对多</p>
<p>角色和权限的对应关系：一对多</p>
<h1 id="二、实战示例"><a href="#二、实战示例" class="headerlink" title="二、实战示例"></a>二、实战示例</h1><ol>
<li><p>添加依赖</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">&lt;dependencies&gt;</span><br><span class="line">    &lt;dependency&gt;</span><br><span class="line">        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</span><br><span class="line">        &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;</span><br><span class="line">    &lt;/dependency&gt;</span><br><span class="line"></span><br><span class="line">    &lt;dependency&gt;</span><br><span class="line">        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</span><br><span class="line">        &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;</span><br><span class="line">    &lt;/dependency&gt;</span><br><span class="line"></span><br><span class="line">    &lt;dependency&gt;</span><br><span class="line">        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</span><br><span class="line">        &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;</span><br><span class="line">    &lt;/dependency&gt;</span><br><span class="line"></span><br><span class="line">    &lt;dependency&gt;</span><br><span class="line">        &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;</span><br><span class="line">        &lt;artifactId&gt;thymeleaf-extras-springsecurity5&lt;/artifactId&gt;</span><br><span class="line">    &lt;/dependency&gt;</span><br><span class="line"></span><br><span class="line">    &lt;dependency&gt;</span><br><span class="line">        &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;</span><br><span class="line">        &lt;artifactId&gt;lombok&lt;/artifactId&gt;</span><br><span class="line">    &lt;/dependency&gt;</span><br><span class="line">&lt;/dependencies&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建权限实体</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">@Data</span><br><span class="line">@Builder</span><br><span class="line">@NoArgsConstructor</span><br><span class="line">@AllArgsConstructor</span><br><span class="line">public class SystemPermission &#123;</span><br><span class="line"></span><br><span class="line">    private Integer id;</span><br><span class="line"></span><br><span class="line">    private String name;</span><br><span class="line"></span><br><span class="line">    private String url;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建角色实体</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">@Data</span><br><span class="line">@Builder</span><br><span class="line">@NoArgsConstructor</span><br><span class="line">@AllArgsConstructor</span><br><span class="line">public class SystemRole &#123;</span><br><span class="line"></span><br><span class="line">    private Integer id;</span><br><span class="line"></span><br><span class="line">    private String name;</span><br><span class="line"></span><br><span class="line">    private List&lt;SystemPermission&gt; permissionList;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建用户实体</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">@Data</span><br><span class="line">@Builder</span><br><span class="line">@NoArgsConstructor</span><br><span class="line">@AllArgsConstructor</span><br><span class="line">public class SystemUser &#123;</span><br><span class="line"></span><br><span class="line">    private Integer id;</span><br><span class="line"></span><br><span class="line">    private String username;</span><br><span class="line"></span><br><span class="line">    private String password;</span><br><span class="line"></span><br><span class="line">    private List&lt;SystemRole&gt; roleList;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建用户业务层</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line">@Service</span><br><span class="line">public class UserService &#123;</span><br><span class="line"></span><br><span class="line">    SystemRole adminRole = SystemRole.builder()</span><br><span class="line">            .id(10001)</span><br><span class="line">            .name(&quot;admin&quot;)</span><br><span class="line">            .build();</span><br><span class="line"></span><br><span class="line">    SystemRole developRole = SystemRole.builder()</span><br><span class="line">            .id(10002)</span><br><span class="line">            .name(&quot;develop&quot;)</span><br><span class="line">            .build();</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    &#123;</span><br><span class="line">        SystemPermission systemPermission1 =</span><br><span class="line">                SystemPermission.builder().id(10002).name(&quot;查询图书信息&quot;).url(&quot;/books&quot;).build();</span><br><span class="line"></span><br><span class="line">        SystemPermission systemPermission2 =</span><br><span class="line">                SystemPermission.builder().id(10003).name(&quot;新增图书&quot;).url(&quot;/books/add&quot;).build();</span><br><span class="line"></span><br><span class="line">        SystemPermission systemPermission3 =</span><br><span class="line">                SystemPermission.builder().id(10004).name(&quot;修改图书&quot;).url(&quot;/books/update&quot;).build();</span><br><span class="line"></span><br><span class="line">        SystemPermission systemPermission4 =</span><br><span class="line">                SystemPermission.builder().id(10005).name(&quot;删除图书&quot;).url(&quot;/books/delete&quot;).build();</span><br><span class="line"></span><br><span class="line">        adminRole.setPermissionList(Arrays.asList(systemPermission1,</span><br><span class="line">                        systemPermission2, systemPermission3, systemPermission4));</span><br><span class="line"></span><br><span class="line">        developRole.setPermissionList(Arrays.asList(systemPermission1));</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    public SystemUser getSystemByUsername(String username) &#123;</span><br><span class="line">        SystemUser user = null;</span><br><span class="line">        // 管理员账户</span><br><span class="line">        if (Objects.equals(username, SystemUsernameConstants.ADMIN_USER_NAME)) &#123;</span><br><span class="line">            user = SystemUser.builder()</span><br><span class="line">                    .id(10001)</span><br><span class="line">                    .username(username)</span><br><span class="line">                    .password(&quot;$2a$10$nqFV2LWYvCckYOtrgm0jKO0PYazuO6tVmGgHleDBVSUjZVSkCl/3e&quot;)</span><br><span class="line">                    .build();</span><br><span class="line">            user.setRoleList(Arrays.asList(adminRole, developRole));</span><br><span class="line">        &#125;</span><br><span class="line">        // 开发账户</span><br><span class="line">        else if (Objects.equals(username, SystemUsernameConstants.DEVELOP_USER_NAME)) &#123;</span><br><span class="line">            user = SystemUser.builder()</span><br><span class="line">                    .id(10002)</span><br><span class="line">                    .username(username)</span><br><span class="line">                    .password(&quot;$2a$10$nqFV2LWYvCckYOtrgm0jKO0PYazuO6tVmGgHleDBVSUjZVSkCl/3e&quot;)</span><br><span class="line">                    .build();</span><br><span class="line">            user.setRoleList(Arrays.asList(developRole));</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        return user;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>结合Spring Security加载用户信息</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">@Service</span><br><span class="line">public class CustomerUserDetailService implements UserDetailsService &#123;</span><br><span class="line"></span><br><span class="line">    @Autowired</span><br><span class="line">    private UserService userService;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException &#123;</span><br><span class="line">        SystemUser user = userService.getSystemByUsername(username);</span><br><span class="line">        if (Objects.isNull(user)) &#123;</span><br><span class="line">            throw new UsernameNotFoundException(username);</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        List&lt;SimpleGrantedAuthority&gt; authorityList = new ArrayList&lt;&gt;();</span><br><span class="line">        for (SystemRole role : user.getRoleList()) &#123;</span><br><span class="line">            for (SystemPermission permission : role.getPermissionList()) &#123;</span><br><span class="line">                authorityList.add(new SimpleGrantedAuthority(permission.getUrl()));</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        return new User(username, user.getPassword(), authorityList);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>自定义webMvc配置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@Configuration</span><br><span class="line">public class CustomerWebMvcConfigure implements WebMvcConfigurer &#123;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    public void addViewControllers(ViewControllerRegistry registry) &#123;</span><br><span class="line">        registry.addViewController(&quot;/login&quot;).setViewName(&quot;login&quot;);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>自定义Spring Security安全配置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">@Configuration</span><br><span class="line">@EnableGlobalMethodSecurity(prePostEnabled = true)</span><br><span class="line">public class WebSecurityConfigure extends WebSecurityConfigurerAdapter &#123;</span><br><span class="line"></span><br><span class="line">    @Autowired</span><br><span class="line">    private CustomerUserDetailService customerUserDetailService;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    protected void configure(HttpSecurity http) throws Exception &#123;</span><br><span class="line">        http</span><br><span class="line">            .authorizeRequests()</span><br><span class="line">                .antMatchers(&quot;/&quot;)</span><br><span class="line">                .permitAll()</span><br><span class="line">                .anyRequest()</span><br><span class="line">                .authenticated()</span><br><span class="line">                .and()</span><br><span class="line">            .formLogin()</span><br><span class="line">                .loginPage(&quot;/login&quot;)</span><br><span class="line">                .failureUrl(&quot;/login/error&quot;)</span><br><span class="line">                .permitAll()</span><br><span class="line">                .and()</span><br><span class="line">            .logout()</span><br><span class="line">                .permitAll();</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @Override</span><br><span class="line">    protected void configure(AuthenticationManagerBuilder auth) throws Exception &#123;</span><br><span class="line">        auth.userDetailsService(customerUserDetailService).passwordEncoder(passwordEncoder());</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @Bean</span><br><span class="line">    public PasswordEncoder passwordEncoder() &#123;</span><br><span class="line">        return new BCryptPasswordEncoder();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>创建控制器</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">@Controller</span><br><span class="line">public class IndexController &#123;</span><br><span class="line"></span><br><span class="line">    @RequestMapping(&quot;/&quot;)</span><br><span class="line">    public String index() &#123;</span><br><span class="line">        return &quot;index&quot;;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">@Controller</span><br><span class="line">public class BookController &#123;</span><br><span class="line"></span><br><span class="line">    @PreAuthorize(&quot;hasAuthority(&apos;/books&apos;)&quot;)</span><br><span class="line">    @RequestMapping(&quot;/books&quot;)</span><br><span class="line">    public String books(Model model) &#123;</span><br><span class="line">        Book book1 = Book.builder().id(10001).name(&quot;射雕英雄传&quot;).publishDate(&quot;2018-12-14 09:00:00&quot;).build();</span><br><span class="line">        Book book2 = Book.builder().id(10002).name(&quot;天龙八部&quot;).publishDate(&quot;2018-12-15 15:20:00&quot;).build();</span><br><span class="line">        Book book3 = Book.builder().id(10003).name(&quot;倚天屠龙记&quot;).publishDate(&quot;2018-12-16 18:05:00&quot;).build();</span><br><span class="line">        Book book4 = Book.builder().id(10004).name(&quot;神雕侠侣&quot;).publishDate(&quot;2018-12-17 13:00:00&quot;).build();</span><br><span class="line">        Book book5 = Book.builder().id(10005).name(&quot;笑傲江湖&quot;).publishDate(&quot;2018-12-18 19:00:00&quot;).build();</span><br><span class="line"></span><br><span class="line">        List&lt;Book&gt; bookList = new ArrayList&lt;&gt;();</span><br><span class="line">        bookList.add(book1);</span><br><span class="line">        bookList.add(book2);</span><br><span class="line">        bookList.add(book3);</span><br><span class="line">        bookList.add(book4);</span><br><span class="line">        bookList.add(book5);</span><br><span class="line"></span><br><span class="line">        model.addAttribute(&quot;bookList&quot;, bookList);</span><br><span class="line">        return &quot;book&quot;;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @PreAuthorize(&quot;hasAuthority(&apos;/books/add&apos;)&quot;)</span><br><span class="line">    @RequestMapping(&quot;/books/add&quot;)</span><br><span class="line">    @ResponseBody</span><br><span class="line">    public String add() &#123;</span><br><span class="line">        return &quot;新增图书&quot;;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @PreAuthorize(&quot;hasAuthority(&apos;/books/update&apos;)&quot;)</span><br><span class="line">    @RequestMapping(&quot;/books/update&quot;)</span><br><span class="line">    @ResponseBody</span><br><span class="line">    public String update() &#123;</span><br><span class="line">        return &quot;修改图书&quot;;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    @PreAuthorize(&quot;hasAuthority(&apos;/books/delete&apos;)&quot;)</span><br><span class="line">    @RequestMapping(&quot;/books/delete&quot;)</span><br><span class="line">    @ResponseBody</span><br><span class="line">    public String delete() &#123;</span><br><span class="line">        return &quot;删除图书&quot;;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">@RequestMapping(&quot;/login&quot;)</span><br><span class="line">@Controller</span><br><span class="line">public class LoginController &#123;</span><br><span class="line"></span><br><span class="line">    @RequestMapping(&quot;/error&quot;)</span><br><span class="line">    public String error(Model model) &#123;</span><br><span class="line">        model.addAttribute(&quot;loginError&quot;, true);</span><br><span class="line">        return &quot;login&quot;;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ol start="10">
<li><p>首页</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html lang=&quot;en&quot;</span><br><span class="line">      xmlns=&quot;http://www.w3.org/1999/xhtml&quot;</span><br><span class="line">      xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;</span><br><span class="line">    &lt;head&gt;</span><br><span class="line">        &lt;meta charset=&quot;UTF-8&quot;&gt;</span><br><span class="line">        &lt;title&gt;Title&lt;/title&gt;</span><br><span class="line">    &lt;/head&gt;</span><br><span class="line">    &lt;body&gt;</span><br><span class="line">        &lt;a th:href=&quot;@&#123;/books&#125;&quot;&gt;进入图书管理&lt;/a&gt;</span><br><span class="line">    &lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p>登录页</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html lang=&quot;zh&quot; xmlns:th=&quot;http://www.thymeleaf.org&quot;&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">    &lt;meta charset=&quot;UTF-8&quot;&gt;</span><br><span class="line">    &lt;title&gt;Login page&lt;/title&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;h1&gt;Login page&lt;/h1&gt;</span><br><span class="line">&lt;p th:if=&quot;$&#123;loginError&#125;&quot; class=&quot;error&quot;&gt;用户名或密码错误&lt;/p&gt;</span><br><span class="line">&lt;form th:action=&quot;@&#123;/login&#125;&quot; method=&quot;post&quot;&gt;</span><br><span class="line">    &lt;label for=&quot;username&quot;&gt;Username&lt;/label&gt;:</span><br><span class="line">    &lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot; autofocus=&quot;autofocus&quot; /&gt; &lt;br /&gt;</span><br><span class="line">    &lt;label for=&quot;password&quot;&gt;Password&lt;/label&gt;:</span><br><span class="line">    &lt;input type=&quot;password&quot; id=&quot;password&quot; name=&quot;password&quot; /&gt; &lt;br /&gt;</span><br><span class="line">    &lt;input type=&quot;submit&quot; value=&quot;Login&quot; /&gt;</span><br><span class="line">&lt;/form&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p>展示页</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html lang=&quot;en&quot;</span><br><span class="line">      xmlns=&quot;http://www.w3.org/1999/xhtml&quot;</span><br><span class="line">      xmlns:th=&quot;http://www.thymeleaf.org&quot;</span><br><span class="line">      xmlns:sec=&quot;http://www.thymeleaf.org/thymeleaf-extras-springsecurity4&quot;&gt;</span><br><span class="line">    &lt;head&gt;</span><br><span class="line">        &lt;meta charset=&quot;UTF-8&quot;&gt;</span><br><span class="line">        &lt;title&gt;Title&lt;/title&gt;</span><br><span class="line">        &lt;link th:href=&quot;@&#123;/bootstrap.min.css&#125;&quot; rel=&quot;stylesheet&quot;/&gt;</span><br><span class="line">    &lt;/head&gt;</span><br><span class="line">    &lt;body&gt;</span><br><span class="line">        &lt;h1&gt;</span><br><span class="line">            Logged in user: &lt;span sec:authentication=&quot;name&quot;&gt;&lt;/span&gt; |</span><br><span class="line">            Roles: &lt;span sec:authentication=&quot;principal.authorities&quot;&gt;&lt;/span&gt;</span><br><span class="line">        &lt;/h1&gt;</span><br><span class="line">        &lt;button sec:authorize=&quot;hasAuthority(&apos;/books/add&apos;)&quot; class=&quot;btn-primary&quot; th:href=&quot;@&#123;/books/add&#125;&quot;&gt;新增&lt;/button&gt;</span><br><span class="line">        &lt;table class=&quot;table table-striped table-hover table-condensed&quot;&gt;</span><br><span class="line">            &lt;thead&gt;</span><br><span class="line">                &lt;tr&gt;</span><br><span class="line">                    &lt;th&gt;编号&lt;/th&gt;</span><br><span class="line">                    &lt;th&gt;名称&lt;/th&gt;</span><br><span class="line">                    &lt;th&gt;出版时间&lt;/th&gt;</span><br><span class="line">                    &lt;th&gt;操作&lt;/th&gt;</span><br><span class="line">                &lt;/tr&gt;</span><br><span class="line">            &lt;/thead&gt;</span><br><span class="line">            &lt;tbody&gt;</span><br><span class="line">                &lt;tr th:each=&quot;book : $&#123;bookList&#125;&quot;&gt;</span><br><span class="line">                    &lt;td th:text=&quot;$&#123;book.id&#125;&quot;&gt;&lt;/td&gt;</span><br><span class="line">                    &lt;td th:text=&quot;$&#123;book.name&#125;&quot;&gt;&lt;/td&gt;</span><br><span class="line">                    &lt;td th:text=&quot;$&#123;book.publishDate&#125;&quot;&gt;&lt;/td&gt;</span><br><span class="line">                    &lt;td&gt;</span><br><span class="line">                        &lt;a sec:authorize=&quot;hasAuthority(&apos;/books/update&apos;)&quot; th:href=&quot;@&#123;/books/update&#125;&quot;&gt;修改&lt;/a&gt;</span><br><span class="line">                        &lt;a sec:authorize=&quot;hasAuthority(&apos;/books/delete&apos;)&quot; th:href=&quot;@&#123;/books/delete&#125;&quot;&gt;删除&lt;/a&gt;</span><br><span class="line">                    &lt;/td&gt;</span><br><span class="line">                &lt;/tr&gt;</span><br><span class="line">            &lt;/tbody&gt;</span><br><span class="line">        &lt;/table&gt;</span><br><span class="line">    &lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p>启动项目，访问 <a href="http://localhost:8080/books" target="_blank" rel="noopener">http://localhost:8080/books</a></p>
</li>
</ol>
<p>使用账号：admin，密码：123456登录，效果如下：<br><img src="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/DBBD0A36-47D3-40B2-936A-B98940BA6BE7.png" alt=""></p>
<p>使用账号：test，密码：123456登录，效果如下：<br><img src="https://mdsystem.oss-cn-hangzhou.aliyuncs.com/blog/7E2F2A68-45FF-4F1A-A8A7-B55B4AF143DF.png" alt=""></p>
<p>从上可以看出已经实现了权限功能，不用的用户分配不同的角色，看到的效果是完全不一样的</p>
<h1 id="注意点："><a href="#注意点：" class="headerlink" title="注意点："></a>注意点：</h1><p>在页面上使用Spring Security的属性：</p>
<ol>
<li><p>首先要引入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">xmlns:sec=&quot;http://www.thymeleaf.org/thymeleaf-extras-springsecurity4&quot;</span><br></pre></td></tr></table></figure>
</li>
<li><p>其次需要在pom中引入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;dependency&gt;</span><br><span class="line">    &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;</span><br><span class="line">    &lt;artifactId&gt;thymeleaf-extras-springsecurity5&lt;/artifactId&gt;</span><br><span class="line">&lt;/dependency&gt;</span><br></pre></td></tr></table></figure>
</li>
</ol>
<p>针对pom的引入，需要参考版本，版本不一致也会导致页面无法展示想要的效果</p>
<p>关于版本选择可以参考<a href="https://github.com/thymeleaf/thymeleaf-extras-springsecurity" target="_blank" rel="noopener">官网版本参考指南</a></p>
<h1 id="github代码"><a href="#github代码" class="headerlink" title="github代码"></a>github代码</h1><p><a href="https://github.com/a601942905git/boot-example/tree/master/boot-example-security2" target="_blank" rel="noopener">Spring Boot Security进阶</a></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Spring-Boot/" rel="tag"># Spring Boot</a>
          
            <a href="/tags/Spring-Security/" rel="tag"># Spring Security</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/12/18/Spring-Boot-Security入门/Spring-Boot-Security入门/" rel="next" title="Spring Boot Security入门">
                <i class="fa fa-chevron-left"></i> Spring Boot Security入门
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/12/18/Spring-Boot-Security进阶-二/Spring-Boot-Security进阶-二/" rel="prev" title="Spring Boot Security进阶(二)">
                Spring Boot Security进阶(二) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Wolf、Heart</p>
              <p class="site-description motion-element" itemprop="description">主要用于分享平时学习的只是以及遇到的困难，帮助自己以及需要的人一起共同成长</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">45</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">14</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">13</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Spring-Boot-Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限"><span class="nav-number">1.</span> <span class="nav-text">Spring Boot Security进阶，实现不同用户分配不用的角色，拥有不同的操作权限</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#一、权限系统分析"><span class="nav-number"></span> <span class="nav-text">一、权限系统分析</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#二、实战示例"><span class="nav-number"></span> <span class="nav-text">二、实战示例</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#注意点："><span class="nav-number"></span> <span class="nav-text">注意点：</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#github代码"><span class="nav-number"></span> <span class="nav-text">github代码</span></a></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wolf、Heart</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
